package com.example.designmodel.chain.dialog

import android.app.Dialog
import android.content.Context
import android.content.DialogInterface
import android.util.Log
import androidx.appcompat.app.AlertDialog
import com.android.baselibrary.app.MainApplication
import com.example.designmodel.R

class FirstDialog(val context: Context) :DialogIntercept{


    override fun intercept(dialogIntercept: DialogChain) {
        show(dialogIntercept)
    }

    override fun show():Boolean{
        return true
    }

    private fun show(dialogIntercept: DialogChain){
        AlertDialog.Builder(context).setTitle("FirstDialog")
            .setPositiveButton("确定"
        ) { _, _ ->
            dialogIntercept.proceed()
        }.setNegativeButton("取消"
        ) { _, _ ->
            dialogIntercept.proceed()
        }.create().show()
    }
}